<template>

  <el-dialog title="问卷设置" :visible.sync="$attrs.visableIf" @close="handleCloseDialog" :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="600px">

    <el-form ref="form" :rules="rules" :model="form" label-width="0px">
      <el-form-item prop="msg" >
        <div class="title">截止时间<span>（问卷截止后，用户打开此问卷会提示此问卷已结束）</span></div>
        <div class="content">
          <el-date-picker
            v-model="form.time"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择日期时间">
          </el-date-picker>
            <el-radio v-model="form.radio" label="1">永久有效<span>可随时更改</span></el-radio>
        </div>

      </el-form-item>
      <el-form-item prop="link" >
        <div class="title">添加跳转链接<span>（选填，客户提交问卷成功后跳转到此链接）</span></div>
        <div class="content">
          <el-input v-model="form.link" placeholder="以http://或https://开头"></el-input>
        </div>

      </el-form-item>

    </el-form>
    <div class="footer-btn">
      <el-button type="primary" @click="handleCloseDialog">取消</el-button>
      <el-button @click="getSend('form')">提交</el-button>
    </div>
  </el-dialog>
</template>

<script>

  export default {
    name: 'sendQuestionnaireSet',
    data() {
      return {
        form: {
          time: null,//时间
          radio:true,//单选
          link:'',//链接
        },
        typeList:[
          {value:1,label:'专属链接、二维码',tips:'一个企微号一个专属链接，填写问卷后只有所属的企微号会打标签、填描述',},
          {value:2,label:'通用链接、二维码',tips:'所有企微号的通用链接，填写问卷后所有是好友的企微号都会打标签、填描述（用时较长）',},
          {value:3,label:'高级群发，专属链接',},
          {value:4,label:'高级群发，通用链接'},
        ],
        rules: {
          'type': [
            { required: true, message: '请选择类型', trigger: 'change' }
          ]
        }
      }
    },
    created() {
    },
    mounted() {
    },
    watch: {},
    methods: {
      getSend() {
        // this.$modal.confirm(`确定要驳回吗？`).then(() => {
        //   reqPayDataCheckNotPass(this.form).then(res => {
        //     this.$modal.msgSuccess('提交成功！');
        //     this.handleCloseDialog();
        //     this.$emit('closeParentDialog');
        //
        //   })
        //
        // })
      },
      handleCloseDialog() {
        this.$emit('update:visableIf', false);
        this.$emit('handleQuery');
        this.$emit('getBiglist');
      }
    }
  }
</script>

<style scoped lang="scss">
::v-deep .el-dialog__body {
  height: auto !important;
}
.title {
  font-weight: bold;
  font-size: 14px;
  span {
    font-weight: 400;
    color: #8C8C8C;
  }
}
.el-radio {
  margin-left: 10px;
}
.content {
  background: #f5f5f5;
  padding: 16px;
  margin-bottom: 24px;
}
  .footer-btn {
    display: flex;
    justify-content: flex-end;
  }
</style>
